<script lang="ts">
    import {fade, fly} from "svelte/transition";
    export let drawerCenter = false;
    //子传父功能
    import { createEventDispatcher } from 'svelte';
    const dispatch = createEventDispatcher();
    const drawerCenterOnClickFalse = () => {
        // 指定一个参数“helloparent 可以随便写，但要与父级对应”向父组件发送消息 n
        dispatch("drawerCenterOnClickFalse",false);
    };


</script>

{#if drawerCenter}
    <div class="see-drawer-center" transition:fade|fly={{delay: 1}}>
        <div class="see-drawer-center-button-style"><button on:click={drawerCenterOnClickFalse}>X</button></div>















    </div>
{/if}

<style>
    .see-drawer-center {
        position: fixed;
        margin: 0 auto;
        top: 2%;
        left: 2%;
        right: 2%;
        bottom: 2%;
        padding: 15px;
        background-color: #4075a6;
        z-index: 99999;
    }
    .see-drawer-center-button-style {
        position: absolute;
        top: 0;
        right: 0;
        z-index: 99999;
    }
</style>
